import Mongoose from 'mongoose';
import BookModel from './BookModel';

Mongoose.connect('mongodb://localhost:27017/book-mall', {
    useNewUrlParser: true,
    useCreateIndex: true,
    useUnifiedTopology: true,
}).then(
    () => console.log('连接数据库成功'),
    (reason) => {
        console.log(`连接失败 -> 失败原因：${reason}`);
    },
);

export { BookModel };
